<%@ page contentType="text/html;charset=UTF-8" language="java" %>

<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
	<base href="${pageContext.request.contextPath}/">
<html>
<head>
<title>毕业设计项目</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link href="../css/style.css" rel="stylesheet" type="text/css">
	<script src="js/jquery-1.9.0.js"></script>
<script src="../script/common.js"></script>
</head>
<script>
    function reload() {
        window.location.href = "cstLost/selectLostBy?lstCustName="+$("#lstCustName").val()+"&lstCustManagerName="+$("#lstCustManagerName").val();
    }

</script>
<body>

<div class="page_title">客户流失分析</div>
<div class="button_bar">
	<button class="common_button" onclick="help('');">帮助</button>
	<button class="common_button" onclick="reload();">查询</button> 
	</div>
	<table class="query_form_table" border="0" cellPadding="3" cellSpacing="0">
		<tr>
			<th>客户名称</th>
			<td><input type="text" id="lstCustName" value=""></td>
			<th>客户经理</th>
			<td><input type="text" id="lstCustManagerName" value=""></td>
		</tr>
	</table>
<br/>
<table class="data_list_table">
		<tr>
			<th align='center' height="28" width="">编号</th>
			<th height="28" align='center'>年份</th>
			<th height="28" align='center'>客户</th>
			<th height="28" align='center'>客户经理</th>
			<th height="28" align='center'>流失原因</th>
		</tr>
		<c:forEach var="cstLost" items="${cstLostList}" varStatus="i">
			<tr>
				<td class="list_data_number" height="27">${i.index+1}</td>
				<td class="list_data_text lstLostDate" height="27">${cstLost.lstLostDate}</td>
				<td class="list_data_text" height="27">${cstLost.lstCustName}</td>
				<td class="list_data_text" height="27">${cstLost.lstCustManagerName}</td>
				<td class="list_data_ltext" height="27">${cstLost.lstReason}</td>

			</tr>
		</c:forEach>
	<tr>
		<th colspan="7" class="pager">
<div class="pager">
	共59条记录 每页<input value="10" size="2" />条
	第<input value="1" size="2"/>页/共5页
	<a href="#">第一页</a>
	<a href="#">上一页</a>
	<a href="#">下一页</a>
	<a href="#">最后一页</a>
	转到<input value="1" size="2" />页
	<button width="20" onclick="reload();">GO</button>
</div>
		</th>
	</tr>

	</table>

<script>
    $(function () {
        var lstLostDate  = $(".lstLostDate");
        $.each(lstLostDate,function () {
			var val = $(this).text();
			val=changetime(val);
            $(this).text(val);
        })
        function changetime(str){
            return new Date(parseInt(str)).toLocaleString().replace(/年|月/g, "-").replace(/日/g, " ");
    	};
    })
</script>
</body>
</html>